package in.muton.edushare.errorPages;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;

import com.edushare.common.constants.URLConstants;

import in.muton.edushare.EduSharePage;
import in.muton.edushare.EduShareSession;
import in.muton.edushare.pages.FooterLinks;
import in.muton.edushare.url.URLLoader;

public class NotAuthorizedPage extends EduSharePage {
	
	
	public NotAuthorizedPage() {
		BookmarkablePageLink<Void> headerLoginLink = 
			new BookmarkablePageLink<Void>("loginLink", URLLoader.getPageClass(URLConstants.LOGIN_PATH));
		if(EduShareSession.get().isLoggedIn()){
			headerLoginLink.add(new Label("loginTxt", "Go back to Home"));
		}else{
			headerLoginLink.add(new Label("loginTxt", "Login"));
		}
		add(headerLoginLink);
		
		
		add(new BookmarkablePageLink<Void>("loginPage", URLLoader.getPageClass(URLConstants.LOGIN_PATH)));
		add(new BookmarkablePageLink<Void>("homePage", URLLoader.getPageClass(URLConstants.LOGIN_PATH)));
		add(new FooterLinks("footerLinks"));
	}
}
